﻿// Decompiled with JetBrains decompiler
// Type: MG_Cooler.MGCoolerConfig
// Assembly: MG_Cooler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 7560BFF2-5E64-4596-AB14-3DB707CE39FE
// Assembly location: E:\docs\Klei\OxygenNotIncluded\mods\Steam\2573951847\MG_Cooler.dll

using TUNING;
using UnityEngine;

namespace MG_Cooler
{
  public class MGCoolerConfig : SpaceHeaterConfig
  {
    public new const string ID = "MGCooler";
    public static string Name = "MGCooler";
    public static string ENDescription = "This Cools down the Area";
    public static string ENEffect = "Uses a smidge of power to cool down the air";
    public static string CNDescription = "冷却空气";
    public static string CNEffect = "薪尽自然凉.";

    public override BuildingDef CreateBuildingDef()
    {
      string id = "MGCooler";
      int width = 2;
      int height = 2;
      string anim = "spaceheater_kanim";
      int hitpoints = 30;
      float construction_time = 30f;
      float[] tieR4 = BUILDINGS.CONSTRUCTION_MASS_KG.TIER4;
      string[] allMetals = MATERIALS.ALL_METALS;
      float melting_point = 1600f;
      BuildLocationRule build_location_rule = BuildLocationRule.Anywhere;
      EffectorValues tieR2 = NOISE_POLLUTION.NOISY.TIER2;
      BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, tieR4, allMetals, melting_point, build_location_rule, BUILDINGS.DECOR.BONUS.TIER1, tieR2);
      //BuildingTemplates.CreateBuildingDef("SteelLadder", 1, 1, "ladder_poi_kanim", 100, 10f, BUILDINGS.CONSTRUCTION_MASS_KG.TIER1, new string[1]{SimHashes.Steel.ToString()}, 2400f, BuildLocationRule.Anywhere, DECOR.BONUS.TIER0, NOISE_POLLUTION.NONE);
      buildingDef.RequiresPowerInput = true;
      buildingDef.EnergyConsumptionWhenActive = 30f;
      buildingDef.ExhaustKilowattsWhenActive = -2000f;
      buildingDef.SelfHeatKilowattsWhenActive = -25f;
      buildingDef.ViewMode = OverlayModes.Power.ID;
      buildingDef.AudioCategory = "Metal";
      buildingDef.Floodable = false;
      buildingDef.Entombable = false;
      buildingDef.LogicInputPorts = LogicOperationalController.CreateSingleInputPortList(new CellOffset(1, 0));
      buildingDef.OverheatTemperature = 800.15f;
      return buildingDef;
    }

    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
      go.AddOrGet<LoopingSounds>();
      go.AddOrGet<MGSpaceCooler>().targetTemperature = 2000f;
      go.AddOrGet<MinimumOperatingTemperature>().minimumTemperature = 16f;
    }

    public override void DoPostConfigureComplete(GameObject go)
    {
      base.DoPostConfigureComplete(go);
      go.AddOrGet<HeaterLogicTemperatureSensor>();
    }
  }
}
